/**
 * Created by Administrator on 2017/12/18 0018.人事招聘
 */
import dynamic from "dva/dynamic";

// wrapper of dynamic
const dynamicWrapper = (app, models, component) =>
  dynamic({
    app,
    models: () => models.map(m => import(`../models/${m}.js`)),
    component
  });

export const PersonnelRecruitment = app => {
  return {
    name: "人事管理",
    icon: "renshizhaopin",
    path: "PersonnelRecruitment",
    children: [
      {
        name: "人员招聘",
        path: "ListContainer",
        component: dynamicWrapper(app, [], () =>
          import("../routes/Personnel/PersonnelRecruitment/ListContainer")
        )
      },
      {
        name: "",
        path: "ListContainer/PositionDetail/:jobId/:type",
        component: dynamicWrapper(app, [], () =>
          import("../routes/Personnel/PersonnelRecruitment/PositionDetail")
        )
      },
      {
        name: "",
        path: "ListContainer/ResumeDetails/:currentResumeId/:type",
        component: dynamicWrapper(app, [], () =>
          import("../routes/Personnel/PersonnelRecruitment/ResumeDetails")
        )
      },
      {
        name: "医社保管理",
        path: "medicalrecord",
        component: dynamicWrapper(app, ["profile"], () =>
          import("../routes/Personnel/Medical/MedicalBasic")
        )
      },
      {
        name: "",
        path: "proportion",
        component: dynamicWrapper(app, ["profile"], () =>
          import("../routes/Personnel/Medical/PayBasic")
        )
      },
      {
        name: "",
        path: "/proporset/:schemeId",
        component: dynamicWrapper(app, ["profile"], () =>
          import("../routes/Personnel/Medical/PaySet")
        )
      },
      {
        name: "奖惩管理",
        path: "incentiveManagement",
        component: dynamicWrapper(app, ["profile"], () =>
          import("../routes/Personnel/IncentiveManagement/ListContainer")
        )
      }
    ]
  };
};
